//
// Created by void on 24-1-20.
//

#ifndef RECTOR_CPP_TCPCONNECTION_H
#define RECTOR_CPP_TCPCONNECTION_H
#include "EventLoop.h"
#include "Buffer.h"
#include "Channel.h"
#include "HttpRequest.h"
#include "HttpResponse.h"
#include <iostream>

using namespace std;

class TcpConnection {
public:
    TcpConnection(int fd, EventLoop* evLoop);
    ~TcpConnection();

    static int processRead(void* arg);
    static int processWrite(void* arg);
    static int destroy(void* arg);

private:
    string m_name;
    EventLoop* m_evLoop;
    Channel* m_channel;
    Buffer* m_readBuf;
    Buffer* m_writeBuf;

    HttpRequest* m_request;
    HttpResponse* m_response;
};


#endif //RECTOR_CPP_TCPCONNECTION_H
